﻿// -----------------------------
// Copyright © Kodi Studios 2011
// -----------------------------

using System.Collections.Generic;
using System.Text.RegularExpressions;

namespace Kodi.Picturethrill
{
    class NatureImageProvider : IImageProvider
    {
        static string siteUrl = "http://www.naturepicoftheday.com";

        List<string> imageUrls = new List<string>();

        public NatureImageProvider()
        {
        }

        public IList<string> ImageUrls
        {
            get
            {
                if (this.imageUrls.Count == 0)
                {
                    // ExampleMatch: <a href=/npods/2011/december/walk_on_the_shore_full.jpg>(full)</a>
                    imageUrls.Add(HtmlUtilities.GetImageUrl(siteUrl, new Regex(@"\<a href\=([^\>]+)\>\(full\)\<\/a\>")));
                }
                return this.imageUrls;
            }
        }

        public string Name
        {
            get
            {
                return "Nature";
            }
        }

        public string SiteName
        {
            get
            {
                return siteUrl;
            }
        }
    }
}
